package com.hyfrogx.modules.sign.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyfrogx.modules.sign.entity.SignGrade;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SignGradeDao extends BaseMapper<SignGrade> {


  @Select("SELECT\n" +
    "\t\tsign_date as signDate,\n" +
    "\t\tcreate_time as createTime,\n" +
    "\t\tdel_flag as delFlag,\n" +
    "\t\tgrade as grade,\n" +
    "\t\tgrade_id as gradeId,\n" +
    "\t\tgrade_type as gradeType,\n" +
    "\t\tsucc_record as succRecord,\n" +
    "\t\tuid as uid\n" +
    "\t\tFROM\n" +
    "\t\tsign_grade\n" +
    "\t\twhere\n" +
    "\t\tuid = #{uid}\n" +
    "\t\tand \n" +
    "\t\tsign_date = #{signDate}")
		SignGrade getRecordBydayAndUid(@Param("uid") Long customerId, @Param("signDate") String yesterday);


	SignGrade getSignRecordByUidAndDay(@Param("uid") Long uid, @Param("createDate") String today);

}
